package com.bit.librarymanagementsystem.DAO;

import com.bit.librarymanagementsystem.Entity.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class BookDAO {

    public List<BookInfo> mockData(){//后端模拟数据
        List<BookInfo> bookList=new ArrayList<>(15);
        for(int i=1;i<=15;i++){//随机创建15本图书
            BookInfo book=new BookInfo();
            book.setId(i);
            book.setBookName("图书"+i);
            book.setCount(i*4+3);
            book.setPrice(new BigDecimal(new Random().nextInt(100)));
            book.setPublish("出版社"+i%5);
            book.setStatus(1);
            book.setAuthor("作者"+i);
            bookList.add(book);
        }
        return bookList;
    }

}
